package com.lz.football.module.wineBar.view
{
	import com.common.stdlib.DateUtil;
	import com.common.utils.timeUtils.TimerManager;
	import com.liangzhong.model.AppData;
	import com.liangzhong.model.winebar.vo.WineBarInfoVo;
	import com.lz.football.module.base.IComponent;
	
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.text.TextField;

	/**
	 *经验面板 
	 * @author lake
	 * 
	 */	
	public class ExpPanel extends Sprite implements IComponent
	{
		/**
		 *皮肤 
		 */		
		private var _symbolSkin 	:MovieClip;
		/**
		 *经验 
		 */		
		private var txtExp 		:TextField;
		/**
		 *时间 
		 */		
		private var txtTime 		:TextField;
		/**
		 *经过的时间 
		 */		
		private var time			:int = 1;
		
		public function ExpPanel()
		{
			super();
		}
		/**
		 *初始化 
		 * 
		 */	
		public function initUI(view:Object=null):void
		{
			_symbolSkin = view as MovieClip;
			txtExp = _symbolSkin.txtExp;
			txtTime = _symbolSkin.txtTime;
			TimerManager.instance.addFunction(onTiming);
			txtExp.htmlText = "累计获得："+ time * AppData.getInstance().winebarManager.levelExp +"点经验";
			txtTime.htmlText = "泡吧时间：" + DateUtil.formatShowHMS(time,true);
		}
		/**
		 *时间计时 
		 */		
		private function onTiming():void
		{
			time ++;
			txtExp.htmlText = "累计获得："+ time * AppData.getInstance().winebarManager.levelExp +"点经验";
			txtTime.htmlText = "泡吧时间：" + DateUtil.formatShowHMS(time,true);
		}
		/**
		 *注册事件 
		 * 
		 */
		public function addEvtListener():void
		{
		}
		/**
		 *删除事件 
		 * 
		 */	
		public function removeEvtListener():void
		{
		}
		/**
		 *销毁 
		 * 
		 */	
		public function destroyView():void
		{
			TimerManager.instance.removeFunction(onTiming);
		}
	}
}